import React from "react";
export default class App extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            arr: []
        }
    }
    componentDidMount() {
        this.$axios
            .get(
                "https://apipc-xiaotuxian-front.itheima.net/home/hot"
            )
            .then(res => {
                // console.log(res);
                if (res.data.msg == '操作成功') {
                    this.setState({
                        arr: res.data.result
                    });
                }

            });
    }
    render() {
        return <div>
            <div className="home-hot" data-v-6a26e2cb="">
                <div className="home-panel" data-v-39dda62a="" data-v-6a26e2cb="">
                    <div className="container" data-v-39dda62a="">
                        <div className="head" data-v-39dda62a="">
                            <h3 data-v-39dda62a="">
                                人气推荐<small data-v-39dda62a="">人气爆款 不容错过</small>
                            </h3>
                        </div>
                        <div data-v-6a26e2cb="" >
                            <ul className="goods-list" data-v-6a26e2cb="">
                                {this.state.arr.map((i, index) => {
                                    return <li data-v-6a26e2cb="" key={index}>
                                        <a
                                            aria-current="page"
                                            href="#"
                                            className="router-link-active router-link-exact-active"
                                            data-v-6a26e2cb=""
                                        ><img
                                                src={i.picture}
                                                alt=""
                                                data-v-6a26e2cb=""
                                            />
                                            <p className="name" data-v-6a26e2cb="">{i.title }</p>
                                            <p className="desc" data-v-6a26e2cb="">{i.alt }</p></a>
                                    </li>
                                })}

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    }
}